# Maintainer:
pkgname=py3-pooch
pkgver=1.8.0
pkgrel=0
pkgdesc="Friend to fetch data files"
url="https://github.com/fatiando/pooch"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-packaging
	py3-platformdirs
	py3-requests
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/fatiando/pooch/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/pooch-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto \
		-k 'not TestZenodoAPISupport and not test_ftp_downloader and not test_check_availability_on_ftp'
		# missing httpserver & ftpserver pytest fixtures
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -r "$pkgdir"/usr/lib/python3*/site-packages/pooch/tests/
}

sha512sums="
2c1fff045438050aae7cfc470c744be26df3d791cdcdeb251167f48140bcd0795505785acdd9b350668db8fd61570a60c3888d5239292eeb46058def4a4b02ba  py3-pooch-1.8.0.tar.gz
"
